﻿<!DOCTYPE html>

<html lang="es-ar">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>Tarasca</title>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    @*<script src="~/Scripts/jquery-1.12.3.min.js" type="text/javascript"></script>*@
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    @*<script src="~/Scripts/bootstrap.js" type="text/javascript"></script>*@
    <script src="http://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/a549aa8780dbda16f6cff545aeabc3d71073911e/src/js/bootstrap-datetimepicker.js"></script>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
    @*<link rel="stylesheet" href="~/Contenido/css/bootstrap.css"/>*@
    <link href="http://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/a549aa8780dbda16f6cff545aeabc3d71073911e/build/css/bootstrap-datetimepicker.css" rel="stylesheet" />
    <link rel="stylesheet" href="~/Contenido/css/bootstrap-theme.css" />
    <link rel="stylesheet" href="~/Contenido/css/bootstrap-switch.css" />

    <link rel="stylesheet" href="~/Contenido/css/jquery-ui/jquery-ui.css" />
    <link rel="stylesheet" href="~/Contenido/css/jquery-ui/jquery-ui.structure.css" />
    <link rel="stylesheet" href="~/Contenido/css/jquery-ui/jquery-ui.theme.css" />
    
    <script src="~/Scripts/bootstrap-switch.js" type="text/javascript"></script>
    <link rel="stylesheet" href="~/Contenido/css/Estilos.css" />
    <link rel="stylesheet" href="~/Contenido/css/Cuentas.css" />
    <link rel="stylesheet" href="~/Contenido/css/Categorias.css" />
    <link rel="stylesheet" href="~/Contenido/css/Movimientos.css" />
    <link rel="stylesheet" href="~/Contenido/css/Perfil.css" />

    <script src="~/Contenido/css/jquery-ui/jquery-ui.js" type="text/javascript"></script>
    
    <script src="~/Scripts/modernizr-1.7.min.js" type="text/javascript"></script>
    <script src="~/Scripts/autoNumeric.js" type="text/javascript"></script>
    <script src="~/Scripts/colors.js" type="text/javascript"></script>
    <script src="~/Scripts/jqColorPicker.js" type="text/javascript"></script>
    <script src="~/Scripts/canvasjs.js" type="text/javascript"></script>

    @*BXSLIDER*@
    <script src="~/Contenido/bxslider/jquery.bxslider.min.js" type="text/javascript"></script>
    <link rel="stylesheet" href="~/Contenido/bxslider/jquery.bxslider.css" />
    <script type="text/javascript">
    $(document).ready(function () {
        $(".errorGlobal").hide();
        EventBinder($(".nombreUsuario"), "click", irLogin);
        EventBinder($(".registrarse"), "click", irRegistrarse);
        EventBinder($(".contenedorLogo"), "click", irInicio);
        EventBinder($(".miCuentaMenu"), "click", irMiCuenta);
        EventBinder($(".misDatosMenu"), "click", irMisDatos);
    });

    function EventBinder(objectToBind, eventName, eventHandler, ignoreInTouch) {
        if (Modernizr.touch) {
            if (ignoreInTouch)
                return;

            if (eventName == "mouseleave")
                objectToBind.bind("focusout", eventHandler);
            else if (eventName == "focusout")
                objectToBind.bind("focusout", eventHandler);
            else
                objectToBind.bind("touchstart", eventHandler);
        }
        //On touch devices, we could also have a mouse plugged in.
        objectToBind.bind(eventName, eventHandler);
    }

    function EventUnBinder(objectToUnBind, eventName, eventHandler) {
        if (Modernizr.touch) {
            objectToUnBind.unbind("touchstart", eventHandler);
        }

        objectToUnBind.unbind(eventName, eventHandler);
    }

    function mostrarMensajeGlobalError(descripcion) {
        $("#mensajeGlobal").text(descripcion);
        $(".errorGlobal").show();
        setTimeout(function () { $(".errorGlobal").fadeOut("slow"); }, 5000);
    }

    function irLogin() {
        window.location = '@Url.Content("~/Auth/Login")';
    }

    function irRegistrarse() {
        window.location = '@Url.Content("~/Auth/Registrarse")';
    }

    function emailValido(email) {
        var regex = /^[a-z0-9\.\_%+-]+@@[a-z0-9\.\-]+\.[a-z]{2,4}$/i;
        return regex.test(email);
    }

    function irRecuperarContraseña() {
        window.location = '@Url.Content("~/Auth/Recuperar/")';
    }

    function irInicio() {
        window.location = '@Url.Content("~/")';
    }

    function irMiCuenta() {
        window.location = '@Url.Content("~/Cuentas")';
    }

    function irMisDatos() {
        window.location = '@Url.Content("~/Perfil/")';
    }
    </script>
</head>
<body>
    <header class="fondoNegro cabecera">
        <div class="container">
            <div class="row show-grid">
                <div class="col-lg-12">
                    <div class="contenedorLogo">
                        <img class="logoTarasca" src="~/Contenido/Imagenes/LogoTarasca.png" />
                        <label>TARASCA</label>
                    </div>
                    <div class="contenedorUsuario">
                        @if (User.Identity.IsAuthenticated)
                        {
                            <label class="nombreUsuarioLogueado">Hola @User.Identity.Name !</label>
                            <label class="miCuentaMenu">| Mi Cuenta </label>
                            <label class="misDatosMenu">| Mis Datos </label>
                            <form class="formCerrarSesion" action="/Auth/CerrarSesion" method="post">
                                <button class="botonCerrarSesion">| Cerrar Sesión</button>
                            </form>
                        }
                        else
                        {
                            <label class="nombreUsuario">INGRESAR</label>
                            <label class="registrarse">| REGISTRARSE</label>
                        }
                    </div>
                </div>
            </div>
        </div>
    </header>
    <div class="container contenedorGlobal">
        <div class="row">
            <div class="col-lg-12">
                @RenderBody()
            </div>
        </div>
    </div>
    <div class="contenedorErrorGlobal">
        <div class="errorGlobal">
            Ha ocurrido un error durante su última acción: 
            <label id="mensajeGlobal">ERROR</label>
        </div>
    </div>
</body>
</html>